<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Exception</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.exceptions.html">预定义异常</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.construct.html">Exception::__construct</a></div>
 <div class="up"><a href="reserved.exceptions.html">预定义异常</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.exception" class="reference">
 <h1 class="title">Exception</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.1.0)</p>
 

  <div class="section" id="exception.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <span class="ooclass"><strong class="classname">Exception</strong></span>是所有异常的基类。
   </p>
  </div>

 
  <div class="section" id="exception.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Exception</strong>
     </span>
     {</div>

 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.exception.html#exception.props.message">$<var class="varname">message</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href="class.exception.html#exception.props.code">$<var class="varname">code</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.exception.html#exception.props.file">$<var class="varname">file</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href="class.exception.html#exception.props.line">$<var class="varname">line</var></a></var>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="exception.construct.html" class="methodname">__construct</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$message</code><span class="initializer"> = &quot;&quot;</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$code</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type"><a href="class.exception.html" class="type Exception">Exception</a></span> <code class="parameter">$previous</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
  ]]] )</div>

    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getmessage.html" class="methodname">getMessage</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">Exception</span><span class="methodname"><a href="exception.getprevious.html" class="methodname">getPrevious</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getcode.html" class="methodname">getCode</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getfile.html" class="methodname">getFile</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getline.html" class="methodname">getLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="exception.gettrace.html" class="methodname">getTrace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.gettraceasstring.html" class="methodname">getTraceAsString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="exception.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="exception.clone.html" class="methodname">__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>
 

 
  </div>
 

  <div class="section" id="exception.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="exception.props.message"><var class="varname"><var class="varname">message</var></var></dt>

     <dd>

      <p class="para">异常消息内容</p>
     </dd>

    
    
     <dt id="exception.props.code"><var class="varname"><var class="varname">code</var></var></dt>

     <dd>

      <p class="para">异常代码</p>
     </dd>

    
    
     <dt id="exception.props.file"><var class="varname"><var class="varname">file</var></var></dt>

     <dd>

      <p class="para">抛出异常的文件名</p>
     </dd>

    
    
     <dt id="exception.props.line"><var class="varname"><var class="varname">line</var></var></dt>

     <dd>

      <p class="para">抛出异常在该文件中的行号</p>
     </dd>

    
   </dl>

  </div>

 
 </div>
 
 





 



 



 



 



 



 



 



 



 



 



 



 







 



 



 



 



 



 



 
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="exception.construct.html">Exception::__construct</a> — 异常构造函数</li><li><a href="exception.getmessage.html">Exception::getMessage</a> — 获取异常消息内容</li><li><a href="exception.getprevious.html">Exception::getPrevious</a> — 返回异常链中的前一个异常</li><li><a href="exception.getcode.html">Exception::getCode</a> — 获取异常代码</li><li><a href="exception.getfile.html">Exception::getFile</a> — 获取发生异常的程序文件名称</li><li><a href="exception.getline.html">Exception::getLine</a> — 获取发生异常的代码在文件中的行号</li><li><a href="exception.gettrace.html">Exception::getTrace</a> — 获取异常追踪信息</li><li><a href="exception.gettraceasstring.html">Exception::getTraceAsString</a> — 获取字符串类型的异常追踪信息</li><li><a href="exception.tostring.html">Exception::__toString</a> — 将异常对象转换为字符串</li><li><a href="exception.clone.html">Exception::__clone</a> — 异常克隆</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.exceptions.html">预定义异常</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="exception.construct.html">Exception::__construct</a></div>
 <div class="up"><a href="reserved.exceptions.html">预定义异常</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
